﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

public partial class AppDevelopment : System.Web.UI.Page
{
    private int TypeId = 0;
    private DBClass db = new DBClass();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.Params["TypeId"] != null)
        {
            Int32.TryParse(Request.Params["TypeId"].ToString(), out TypeId);            
        }
        if (TypeId <= 0)
        {
            Response.Redirect("Default.aspx");
        }
        else
        {
            LoadTitleAndIntroduction();
        }
    }

    private void LoadTitleAndIntroduction()
    {
        DataTable dt = db.GetInfoTypeByTypeId(TypeId);
        if (dt != null && dt.Rows.Count > 0)
        {
            DataRow row = dt.Rows[0];
            lblTitleAppDev.Text = row["TypeName"].ToString();
            Title = row["TypeName"].ToString();
            LiteralIntro.Text = row["Introduction"].ToString();
            lblTitleFactList.Text = row["ShortName"].ToString() + " Fact List";
            lblDevelopment.Text = row["ShortName"].ToString() + " Development";
            lblTitleDeployment.Text = row["ShortName"].ToString() + " Deployment";
        }
        else
        {
            Response.Redirect("ErrorPage.aspx");
        }
    }

    protected void rptDefaultRight_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        //RepeaterItem item = (RepeaterItem)e.Item;
        //Repeater rptDetail = (Repeater)rptDefaultRight.FindControl("rptDetail");
        //if (rptDetail != null)
        //{
        //    //db
        //}
    }
}